{% extends "default/base.html" %}
{% block content %}
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div id="ibox-content" class="ibox-title">
                        <h5> 发布权限详细信息 </h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a href="#">未启用 1</a>
                                </li>
                                <li><a href="#">未启用 2</a>
                                </li>
                            </ul>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>

                    <div class="ibox-content">
                        {% include "auth/active.html" %}
                        <br/>
                        <div class="tab-content">
                            <table class="table table-striped table-bordered table-hover ">
                                <thead>
                                <tr>
                                    <th class="text-left"><i class="glyphicon glyphicon-user"></i>发布名称</th>
                                    <th class="text-center"> 所属项目</th>
                                    <th class="text-center">
                                        <li class="glyphicon glyphicon-cog"></li>
                                        权限管理
                                    </th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for i in project_swan_obj %}
                                    <tr class="gradeX">
                                        <td id="username"> {{ i.swan_name }} </td>
                                        <td class="text-center" id="ip"> {{ i.project_name }} </td>
                                        <td class="text-center" id="start_time">
                                            <a href="{% url 'push_permission_member_mgr' pk=i.pk %}"
                                               class="select_node">成员管理</a>
                                        </td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                            <div class="row">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $(function () {
            $('.select_node').on('click', function (event) {
                var height = $(window).height(), index = $.layer({
                    type: 2,
                    shade: [0.5, '#000', true],
                    shadeClose: true,
                    maxmin: true,
                    fix: true,
                    moveOut: true,
                    shift: 'top',
                    border: [10, 0.3, '#000'],
                    title: "权限分配",
                    area: ['800px', (height - 50) + 'px'],
                    //area : ['80%', (height - 50)+'px'],
                    iframe: {src: $(this).attr('href')}
                });
                event.preventDefault();
            });

            $(document).on("click", ".voilet_restart", function (e) {
                e.preventDefault();
                var url = $(this).attr("href");
                $.layer({
                    shade: [0],
                    area: ['auto', 'auto'],
                    dialog: {
                        msg: '您确认要修改解角色状态',
                        btns: 2,
                        type: 4,
                        title: '更改角色状态',
                        btn: ['确认', '取消'],
                        yes: function () {
                            $.ajax({
                                type: "GET",
                                url: url
                            }).done(function (data) {
                                window.location.reload();
                            });
                        }
                    }
                });
            });


        });
    </script>

{% endblock content %}